package net.pinnoocle.playdao.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.pinnoocle.playdao.entity.Group;
import net.pinnoocle.playdao.entity.shopPc.group.ShopGroupListPageVo;
import net.pinnoocle.playdao.entity.shopPc.group.ShopGroupListSearchParams;
import net.pinnoocle.playdao.entity.shopPc.group.ShopPcGroupDetailVo;
import net.pinnoocle.playdao.entity.web.group.*;
import net.pinnoocle.playdao.entity.web.master.MasterGroupListVo;
import net.pinnoocle.playdao.entity.web.user.homepage.RecommendGroupVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 组局表(Group)表数据库访问层
 *
 * @author ye
 * @since 2021-10-25 10:23:23
 */
@Mapper
public interface GroupDao extends BaseMapper<Group> {

    /**
     * 小程序端组局详情
     * @param groupId
     * @return
     */
    GroupDetailVo webGroupDetail(@Param("groupId") String groupId);

    /**
     * 店铺端组局详情
     * @param groupId
     * @return
     */
    ShopPcGroupDetailVo shopGroupDetail(@Param("groupId") String groupId);

    /**
     * 未成局列表
     * @param page
     * @param params
     * @return
     */
    Page<GroupListPageVo> groupList(Page page, @Param("params")GroupListSearchParams params);

    /**
     * 店铺组局列表
     * @param page
     * @param params
     * @return
     */
    Page<ShopGroupListPageVo> shopGroupList(Page page, @Param("params") ShopGroupListSearchParams params);

    /**
     * 入局人员列表
     * @return
     */
    RecommendGroupVo groupJoinUserList(@Param("groupId") String groupId);

    /**
     * 主持人组局列表
     * @param params
     * @return
     */
    List<MasterGroupListVo> masterGroupList(@Param("params")MasterGroupListSearchParams params);

    /**
     * 门店组局列表
     * @param params
     * @return
     */
    List<MasterGroupListVo> shopWebGroupList(@Param("params") ShopWebGroupListSearchParams params);

    /**
     * 最新未支付完的组局
     * @param shopId
     * @return
     */
    String lastGroup(@Param("shopId") String shopId);
}